package me.yan.exception;

public class BusinessException extends RuntimeException {
    protected String errorCode;
    protected String[] errorMessageArguments;
    public BusinessException() {
        super();
    }

    public BusinessException(String message) {
        super(message);
    }
    public static BusinessException withErrorCode(String errorCode) {
        BusinessException businessException = new BusinessException();
        businessException.errorCode = errorCode;
        return businessException;
    }
    public BusinessException withErrorMessageArguments(String... errorMessageArguments) {
        if(errorMessageArguments != null) {
            this.errorMessageArguments = errorMessageArguments;
        }

        return this;
    }
}
